package com.westos.userauth.dao.impl;

import com.westos.userauth.dao.PartyAttributeDao;
import com.westos.userauth.dao.mybatis.PartyAttributeDAO;
import com.westos.userauth.domain.PartyAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Date 2020/11/15 14:40
 * @Created by 张佳妮
 */

@Service
public class MybatisPartyAttributeDao implements PartyAttributeDao {

    @Autowired
    private PartyAttributeDAO partyAttributeDAO;

    @Override
    public int deletePartyAttributeByPartyId(String partyId) {
        return partyAttributeDAO.deletePartyAttributeByPartyId(partyId);
    }

    @Override
    public int insertPartyAttribute(PartyAttribute partyAttribute) {
        return partyAttributeDAO.insertPartyAttribute(partyAttribute);
    }

    @Override
    public int updatePartyAttribute(PartyAttribute partyAttribute) {
        return partyAttributeDAO.updatePartyAttribute(partyAttribute, partyAttribute.getPartyId());
    }

    @Override
    public int deletePartyAttribute(String partyId) {
        return partyAttributeDAO.deletePartyAttribute(partyId);
    }

    @Override
    public List<PartyAttribute> queryAttributeByAttrName(String attrName) {
        return partyAttributeDAO.queryPartyAttributeByAttrName(attrName);
    }

    @Override
    public PartyAttribute queryAttribute(String partyId) {
        PartyAttribute partyAttribute = partyAttributeDAO.queryAttribute(partyId);
        return partyAttribute;
    }

    public PartyAttributeDAO getPartyAttributeDAO() {
        return partyAttributeDAO;
    }

    public void setPartyAttributeDAO(PartyAttributeDAO partyAttributeDAO) {
        this.partyAttributeDAO = partyAttributeDAO;
    }
}
